PDF.co icon

PDF.co

Automate document workflows with OCR, AI invoice parsing, data extraction, conversion, form filling, merging/splitting, and barcode processing. Ideal for invoices, forms, and scanned files.

Convert To PDF

AI-generated

Summary

Convert a file at a publicly accessible URL to PDF, selecting a conversion type for CSV, documents, email, images, XLS, or XLSX. Optional settings can control conversion details, output naming, link expiry, source URL authentication, and callbacks.

Inputs

  • authentication — Choose OAuth2 or API Key authentication; OAuth2 is the default.
  • convertType (required) — Select CSV, document (RTF, DOC, DOCX, TXT), email (MSG or EML), image (JPG, PNG, TIFF), XLS, or XLSX to PDF. The UI declares Document to PDF as the default.
  • url (required) — Direct URL of the file to convert; the UI says it must be publicly accessible.
  • worksheetIndex — Worksheet index to convert for XLS and XLSX inputs; the UI shows a placeholder of 0.
  • advancedOptionsCommon — For document, XLS, XLSX, and image conversions: optional custom profiles JSON, output file name, HTTP username and password for accessing the source URL, output link expiration in minutes (default 60), and callback/webhook URL.
  • advancedOptionsCsv — For CSV conversion: optional automatic page sizing (default enabled), custom profiles JSON, output file name, HTTP username and password, output link expiration in minutes (default 60), and callback/webhook URL.
  • advancedOptionsEmail — For email conversion: optional attachment conversion and embedding (both default enabled), custom paper size, custom profiles JSON, output file name, margins, orientation (portrait by default), output link expiration in minutes (default 60), paper size (Letter by default), and callback/webhook URL.

Output shape

Not established by the provided source pack.

The source pack shows only the execute function signature for this operation, without its body or response handling. The supplied properties describe conversion inputs, but do not establish the returned data shape.

Examples

Example 1: Convert a Word document to PDF

Choose Document to PDF and provide the document's direct URL. Optionally set a file name or source URL credentials in Advanced Options.

Example 2: Convert one worksheet from an Excel file

Choose XLS or XLSX to PDF, provide the file URL, and set the worksheet index. Optionally adjust output link expiration or add a callback URL.

Links

Discussion